package com.example.administrator.myproject.home

import android.content.Context
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView

import com.example.administrator.myproject.R

class CommimtAdapter(private val mContext: Context) : RecyclerView.Adapter<CommimtAdapter.Holder>() {
    private val list: List<AddCart>? = null
    private val inflater: LayoutInflater

    override fun onCreateViewHolder(viewGroup: ViewGroup, i: Int): Holder {
        val view = inflater.inflate(R.layout.com_item_item, viewGroup, false)
        return Holder(view)
    }

    override fun onBindViewHolder(holder: Holder, i: Int) {
        //        holder.tv1.setText(list.get(i).getName());
        //        holder.tv2.setText(list.get(i).getCreatedAt());
        //        holder.tv3.setText(list.get(i).getType());
    }

    override fun getItemCount(): Int {
        return 3
    }

    inner class Holder(itemView: View) : RecyclerView.ViewHolder(itemView) {
        private val tv1: TextView
        private val tv2: TextView
        private val tv3: TextView

        init {
            tv1 = itemView.findViewById(R.id.tv1)
            tv2 = itemView.findViewById(R.id.tv2)
            tv3 = itemView.findViewById(R.id.tv3)
        }
    }

    init {
        this.inflater = LayoutInflater.from(mContext)
    }
}
